﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Playkanaler.Channels.Svt;
using Playkanaler.Channels.Tv4;

namespace Playkanaler
{
   
    public class ChannelView : View
    {
        public ChannelView()
        {
            this.ContentName = "LargeChannelItem";
            this.Name = "Large";
            ShowFocus = true;
            Height = 250;
            Width = 255;
            EndPadding = 450;
        }
    }



    public class StartSetting:Setting
    {
        public StartSetting()
        {
            Tab t = new Tab("kanaler",0);
            Group g = new Group();

                       

            string pf = "resx://Playkanaler/Playkanaler.Resources/";


            Item i = new Item("SVT", 0, pf+ "svt");
            i.Attributes["setting"] = new SvtStartSetting();
            g.Add(i);

            
            i = new Item("TV3", g.Count, pf + "tv3");
            i.Attributes["setting"] = new TV3Setting();
            g.Add(i);


            i = new Item("TV4", 0, "");
            i.Attributes["setting"] = new TV4StartSetting();
            g.Add(i);
           
            i = new Item("TV6", g.Count, pf + "tv6");
            i.Attributes["setting"] = new TV6Setting();
            g.Add(i);

           
            i = new Item("TV8", g.Count, pf + "tv8");
            i.Attributes["setting"] = new TV8Setting();
            g.Add(i);

           
            i = new Item("Viasat Sport", g.Count, pf + "sport");
            i.Attributes["setting"] = new SportSetting();
            g.Add(i);


            t.Add(g);

            Tabs.Add(t);

            SelectedTabIndex = 0;

            View = SelectedTab.View = new ChannelView();

            Heading = "Play-kanaler";

        }
        public override void ClickItem(Item item)
        {
            Setting vs = (Setting)item.Attributes["setting"];           
            Dictionary<string, object> ps = new Dictionary<string, object>();
            ps.Add("Setting", vs);
            Microsoft.MediaCenter.Hosting.PageSession.Current.GoToPage("resx://Playkanaler/Playkanaler.Resources/Default#Default", ps);
        }
    }
}
